import {ref} from 'vue'
//防抖动的钩子
export function debounce(func,delay){
    let timer =null
    return function(...args){
        if(timer) clearTimeout(timer)
        setTimeout(()=>{
            func.apply(this,args)
        },delay)
    }
}
//回到顶部的钩子
export  function backTopFunc(){
    let isShow=ref(false)

    function backStart(value){
        console.log(value)
        value.scrollToTop(0,0)
    }

    return {
        isShow,
        backStart
    }
}
